package io.github.xbeeant.eoffice.onlyoffice;

import java.util.Arrays;
import java.util.List;

/**
 * @author xiaobiao
 * @version 2021/7/12
 */
public class DocumentType {
    private static final List<String> cell = Arrays.asList("csv", "fods", "ods", "ots", "xls", "xlsm", "xlsx", "xlt", "xltm", "xltx");
    private static final List<String> slide = Arrays.asList("fodp", "odp", "otp", "pot", "potm", "potx", "pps", "ppsm", "ppsx", "ppt", "pptm", "pptx");
    private static final List<String> word = Arrays.asList("doc", "docm", "docx", "dot", "dotm", "dotx", "epub", "fodt", "fb2", "htm", "html", "mht", "odt", "ott", "pdf", "rtf", "txt", "djvu", "xml", "xps");

    public static String getDocumentType(String extension) {
        if (cell.contains(extension)) {
            return "cell";
        }

        if (slide.contains(extension)) {
            return "slide";
        }

        if (word.contains(extension)) {
            return "word";
        }

        return "";
    }
}
